<?php
namespace user\Model;
use Think\Model\RelationModel;

class JifeiModel extends RelationModel {
      //定义主表的表名称
protected $tableName='jifeiip_log';    
protected $_link = array(
  'news' => array(   
    'mapping_type'  => self::BELONGS_TO ,    //只查询一条
    'class_name'    => 'news',              //关联的模型名称
    'foreign_key'   => 'news_id',                //news要关联的字段
    'mapping_name'  => 'news',           
    //'parent_key'  =>  'news_id',            //关联表的需要关联的字段
    "mapping_fields"=>"title",              //要查询的字段
    'mapping_order' => 'id asc',            //排序
     ),
  );
 }

?>